/*
This file is part of Docking@Home.
http://docking.gcl.cis.udel.edu
Copyright (C) 2009 University of Delaware

Docking@Home is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Docking@Home is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Docking@Home.  If not, see <http://www.gnu.org/licenses/>.
*/
/*
	Filename: TextButton.h
	Description: A button in the UI that is represented by text
	Revision History: 
		Created - 01/14/08
	Author: Robert Keller (01/14/08 -> current)
*/

#ifndef _TextButton_h
#define _TextButton_h

#include "Button.h"

#define TEXTIMAGE_MAX_NAME_LENGTH 256

class TextButton : public Button
{
public:

	// Constructor / Destructor

	TextButton();
	TextButton(const char n[TEXTIMAGE_MAX_NAME_LENGTH]);
	TextButton(const char n[TEXTIMAGE_MAX_NAME_LENGTH],
		float xVal, float yVal);
	TextButton(const char n[TEXTIMAGE_MAX_NAME_LENGTH],
		float xVal, float yVal, 
		float xs, float ys, float zs, float a);
	~TextButton();

	// Initialization Functions

	void init (const char n[TEXTIMAGE_MAX_NAME_LENGTH],
		float xVal, float yVal,
		float xs, float ys, float zs, float a);

	// Member Modifiers

	void setName (const char n[BUTTON_MAX_NAME_LENGTH]);
	
	void setTextXScale (float x);
	void setTextZScale (float y);
	void setTextYScale (float z);

	void determineWidthHeight();

	// Required Button Functions 
	
	bool determineState (int x, int y, int clicked);

	void resize (float scaleX, float scaleY);
	void resizeSameBottom (float scaleX, float scaleY,
		int standardHeight, int windowHeight);
	void resizeSameLeft (float scaleX, float scaleY,
		int standardWidth, int windowWidth);

	void draw ();
	void drawSelected ();
	void drawUnselected ();
	void drawHovered ();

private:

	// Scale Variables Based on 600x400 window
	float textXScale; 
	float textYScale; 
	float textZScale;

	// Scale variables of current window size
	float currTextXScale;
	float currTextYScale;

	float currXShift;
	float currYShift;

	// Text Properties based on font, name, etc.
	int textWidth;
	int textMax_ascent;
	int textMax_descent;

	// Alpha Blending Value
	float alpha;

};

#endif
